<template>
  <div id="cesiumContainer" style="width: 100%; height: 100vh;"></div>
</template>
<!-- cesium的使用-->
<script setup lang="ts">
import * as Cesium from 'cesium'
import { onMounted } from 'vue'
onMounted(() => {
  const viewer = new Cesium.Viewer('cesiumContainer', {
    infoBox: false, // 禁用沙箱，解决控制台报错
    navigationHelpButton: false,
  })
  viewer.camera.setView({
    // 设置相机位置，经度，纬度，高度
    destination: Cesium.Cartesian3.fromDegrees(118.03, 24.485, 10000),
    orientation: {
      // 初始视角
      heading: Cesium.Math.toRadians(0), // 偏航角，单位弧度
      pitch: Cesium.Math.toRadians(-45), // 仰俯角，单位弧度
      roll: Cesium.Math.toRadians(0)  // 翻滚角，单位弧度
    }
  })
  viewer.scene.globe.enableLighting = true
  viewer.scene.skyBox.show = false
})
</script>
<style scoped lang="scss">
</style>
